package com.example.firstdemo.service;

import com.example.firstdemo.entity.User;
import com.example.firstdemo.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Autowired
    public UserMapper userMapper;

    public List<User> findByGoodsName(String goodsName){
        return userMapper.findUserByGoodsName(goodsName);
    }

    public User insertUser(User user){
        userMapper.insertUser(user);
        return user;
    }

    public List<User> listUser(){

        return userMapper.listUser();
    }

    public int update(User user){

        return userMapper.Update(user);
    }

    public int delete(int goodsId){
        return userMapper.delete(goodsId);
    }

}
